package com.itheima.charsetdemo;

import java.nio.charset.StandardCharsets;

public class CharsetDemo1 {

    public static void main(String[] args) {
        String str = "你好ab";
        System.out.println(str);

        byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
        for (byte b : bytes) {
            System.out.println(b);
        }

        String str2 = new String(bytes, StandardCharsets.UTF_16);
        System.out.println(str2);
    }
}
